<?php

use backend\widgets\Bar;
use common\libs\Constants;
use backend\grid\CheckboxColumn;
use backend\grid\ActionColumn;
use backend\grid\GridView;
use yii\widgets\Pjax;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title                   = "搜索管理";
$this->params['breadcrumbs'][] = "搜索管理";
?>
<div class="row">
    <div class="col-sm-12">
        <div class="ibox">
            <?= $this->render('/widgets/_ibox-title') ?>
            <div class="ibox-content">
                <?= Bar::widget() ?>
                <?php Pjax::begin(); ?>            <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'columns'      => [
                        ['class' => CheckboxColumn::className()],

                        'id',
                        [
                            'attribute' => 'name',
                            'label'     => "名称",


                        ],
                        'value',
                        [
                            'attribute' => 'type',
                            'filter'    => \common\libs\Constants::getSearchPartTypes(),
                            'value'     => function ($model) {
                                return Constants::getSearchPartTypes($model->type);
                            }
                        ],

                        ['class' => ActionColumn::className(),],
                    ],
                ]); ?>
                <?php Pjax::end(); ?>
            </div>
        </div>
    </div>
</div>
